home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
55671
/
55671.xpi
/
chrome
/
snipit.jar
/
content
/
options.js
< prev
next >
Wrap
Text File
|
2008-04-18
|
2KB
|
44 lines
function snipit_loadOptions()
{
const prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
if (prefs.prefHasUserValue("snipit.ssl"))
{
document.getElementById("snipit.ssl").checked = prefs.getBoolPref("snipit.ssl");
}
else
{
document.getElementById("snipit.ssl").checked = false;
}
if (prefs.prefHasUserValue("snipit.openpagein"))
{
document.getElementById("snipit.openpagein").value = prefs.getComplexValue("snipit.openpagein", Components.interfaces.nsISupportsString).data;
}
else
{
document.getElementById("snipit.openpagein").value = "tab";
}
if (prefs.prefHasUserValue("snipit.contextmenuitem"))
{
document.getElementById("snipit.contextmenuitem").checked = prefs.getBoolPref("snipit.contextmenuitem");
}
else
{
document.getElementById("snipit.contextmenuitem").checked = true;
}
}
function snipit_saveOptions()
{
const prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
const string = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
prefs.setBoolPref("snipit.ssl", document.getElementById("snipit.ssl").checked);
prefs.setBoolPref("snipit.contextmenuitem", document.getElementById("snipit.contextmenuitem").checked);
string.data = document.getElementById("snipit.openpagein").value;
prefs.setComplexValue("snipit.openpagein", Components.interfaces.nsISupportsString, string);
}